package cn.tedu.flower.manage.Express.dao;

import cn.tedu.flower.manage.Express.entity.Express;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ExpressDao {
    @Select("SELECT * FROM express")
    List<Express> findAll();

    @Select("SELECT * FROM express WHERE id = #{id}")
    Express findById(int id);

    @Insert("INSERT INTO express (name, address) VALUES (#{name}, #{address})")
    void addExpress(Express express);

    @Update("UPDATE express SET name = #{name}, address = #{address} WHERE id = #{id}")
    void updateExpress(Express express);

    @Delete("DELETE FROM express WHERE id = #{id}")
    void deleteExpress(int id);
}
